<?php
	$css_list[0]['url'] = './tpl/css/mailrss.css';
	$js_list[0][] = './public/js/jquery.slides.js';
?>
<!--{template inc/header}-->
<div id="body" class="wrapper">
    <div id="content_body_wrap" class="fl mt20">
         <div class="piece" >
             <div class="piece_hd" > <b class="hl"></b> <b class="hr"></b> </div>
                            <div class="piece_bd">
                                <div class="bd_head">
                                    <div class="h_left fl"><img src="{$rss_cate_item['cate_icon']}"/></div>
                                    <div class="h_detail ">
                                        <h3>{$rss_cate_item['short_name']}</h3>
                                        <p>{$rss_cate_item['about']}</p>
                                    </div>
                                </div>
                     
                                <div class="bd_content" >
                                    <div class="frame_box" >
                                        <div class="fx_hd">
                                            <img src="{$rss_cate_item['cate_logo']}"/>
                                        </div>
                                        <div class="fx_con">
                                            <div class="left_img fl">
                                                <img style="cursor: pointer;width: 300px;" src ="{$rss_cate_item['cate_img']}"/>
                                            
                                            </div>
                                            <div class="right_detail fl">
                                                <p>
                                                   {$rss_cate_item['desc']}</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="clear"></div>
                                    
                                </div>
                                <div class="fx_mask">
                                            <div class="fx_subcon">
                                                <div class="fx_subing">
                                                    <!--{if $rss_cate_item['is_rss'] == 1 }-->
                                                    <span style="color: #A0A0A0;font-size: 12px;position: relative;top: 6px;left: 20px;">已订阅，<a href="javascript:;" onclick="RemoveRss({$rss_cate_item['cate_id']},this);" style="color:#1E5494">取消订阅</a></span>
                                                    <!--{else}-->
                                                        <div class="green_button fl">
                                                        <input type="button" value="立即订阅" onclick="AddRss({$rss_cate_item['cate_id']},this)"/>
                                                        </div>
                                                        <span style="color: #A0A0A0;font-size: 12px;position: relative;top: 6px;left: 20px;">以上是本栏目部分预览效果，阅读全文请订阅此栏目。</span>
                                                    <!--{/if}-->
                                                    
                                                </div>
                                              </div>
                                        </div>
                            </div>
             <div class="piece_ft" > <b class="fl"></b> <b class="fr"></b> </div>
		</div>

    </div>
    	 <div id="right_side" class="fr mt20">
        <div class="piece piece_ws" >
			<div class="piece_hd" > <b class="hl"></b> <b class="hr"></b> </div>
			<div class="piece_bd">
				<h3>订阅快报</h3>
                                <!--{if $rss_user_list}-->
				<ul class="rss_user_list">
                                    <!--{loop $rss_user_list['list'] $rss_user_item}-->
					<li>
						<p><a class="tlink" target="_blank" href="{u u/index uid=$rss_user_item['uid']}">{$rss_user_item['user_name']}</a>订阅了</p>
						<p class="gl_gt" ><a class="glink" target="_blank" href="{u mailrss/show id=$rss_user_item['cate_id']}">{$rss_user_item['short_name']}</a></p>
					</li>
                                       <!--{/loop}-->
				</ul>
                                <!--{/if}-->
			</div>
			<div class="piece_ft" > <b class="fl"></b> <b class="fr"></b> </div>
		</div>
            </div>
</div>
<!--{template inc/footer}-->
<script>
function AddRss(cate_id,obj){
        var query = new Object();
        query.cate_id = cate_id;
        if(USER_ID == 0){
            alert('请先登录，再进行订阅操作！');
        }
        $.ajax({
                    url: SITE_PATH+"mailrss.php?action=ajax_rss",
                    type: "POST",
                    data:query,
                    cache:false,
                    dataType:'json',
                    success:function(result){
                            if(result.status == 0){
                                alert('订阅失败,请稍候再试！');
                            }
                            else
                            {   
                                var html_str = '<span style="color: #A0A0A0;font-size: 12px;position: relative;top: 6px;left: 20px;">已订阅，<a href="javascript:;" onclick="RemoveRss('+query.cate_id+',this);" style="color:#1E5494">取消订阅</a></span>';
                                $(".fx_subing").html(html_str);
                            }
                    },
                    error:function(){
                            
                    }
                });
 }
function RemoveRss(cate_id,obj){
        var query = new Object();
        query.cate_id = cate_id;
        $.ajax({
                    url: SITE_PATH+"mailrss.php?action=ajax_remove_rss",
                    type: "POST",
                    data:query,
                    cache:false,
                    dataType:'json',
                    success:function(result){
                            if(result.status == 0){
                                alert('取消订阅失败,请稍候再试！');
                            }
                            else
                            {
                                var rss_count = parseInt($(obj).parent().parent().find("b").html());
                                $(obj).parent().parent().find("b").html(rss_count-1);
                                var html_str = '<div class="green_button fl"><input type="button" value="立即订阅" onclick="AddRss('+cate_id+',this)"/></div>'+
                                               '<span style="color: #A0A0A0;font-size: 12px;position: relative;top: 6px;left: 20px;">以上是本栏目部分预览效果，阅读全文请订阅此栏目。</span>';
                                $(obj).parent().html(html_str);
                            }
                    },
                    error:function(){
                            
                    }
                });
}
</script>